<?php
/**
 *	[TWCMS] (C)2012 TongWang Inc.
 *	$Id: content_show_add.tpl.php 2 2013-04-27 07:14:17Z nanown@qq.com $
 */
	defined('IN_TWCMS') || exit('Access Denied');
	include load_tpl('head');
	echo getTwEditor($this->G);
?>

	<script type="text/javascript" charset="utf-8" src="<?=TWCMS_EDITOR?>editor_config.js"></script>
	<script type="text/javascript" charset="utf-8" src="<?=TWCMS_EDITOR?>editor_all_min.js"></script>

	<div class="p c1">
		<div class="cc">
			<form id="one" action="<?=$this->form?>" method="POST">
			<table class="tb">
				<tr>
					<th><b>*</b>分类</th>
					<td>
						<select id="cid" name="cid" class="se1">
							<?php $this->get_category_select(); ?>
						</select>
					</td>
				</tr>
				<tr>
					<th><b>*</b>标题</th>
					<td><input name="title" type="text" value="" class="inp w1" /></td>
				</tr>
				<tr>
					<th>图片</th>
					<td><input name="pic" type="text" value="" class="inp w1" /></td>
				</tr>
				<!-- <tr>
					<th>Tags</th>
					<td><input name="tags" type="text" value="" class="inp w1" /></td>
				</tr> -->
				<tr>
					<th><b>*</b>内容</th>
					<td><textarea id="content" name="content"></textarea></td>
				</tr>
			</table>
			<div class="tb_b"><input type="submit" value="&#20445;&#23384;" class="but1" /></div>
			</form>
		</div>
	</div>
</div>
<script type="text/javascript">
var editor = UE.getEditor('content',{
	minFrameHeight:240,
	catchRemoteImageEnable:true
});

$("form:first").submit(function(){ editor.sync(); });
twAjax.submit("form:first", function(data){
	twAjax.alert(data);
	if(window.twD.err==0) {
		var temp = $("#cid").val();
		I("one").reset(); //重置表单
		editor.setContent("");
		$("#cid").val(temp);
	}
});
</script>
</body>
</html>